<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<body>
<%--原代码--%>
<%--<div class="pull-left">
    <div class="form-group form-inline">
        总共${pageInfo.pages} 页，共${pageInfo.total} 条数据。
    </div>
</div>--%>
<%--改的代码--%>
<div class="pull-left">
    <div class="form-group form-inline">
        总共${pageInfo.pages} 页，共${pageInfo.total}条数据。 每页
        <select class="form-control" id="SelectPageSize" onchange="goPage(1)" >
            <c:forEach var="num" begin="1" end="10" step="1">
                <option value="${num}" ${pageInfo.pageSize == num?'selected':''}>${num}</option>
            </c:forEach>
            <%--<c:forEach var="num" begin="1" end="10" step="1">
                <option value="${num}" ${pageInfo.pageSize == num ? 'selected':''}>${num}</option>
            </c:forEach>--%>
            <%--<option value="5" ${pageInfo.pageSize == 5 ? 'selected':''}>5</option>
            <option value="15" ${pageInfo.pageSize == 10 ? 'selected':''}>10</option>
            <option value="20" ${pageInfo.pageSize == 15 ? 'selected':''}>15</option>
            <option value="50" ${pageInfo.pageSize == 20 ? 'selected':''}>20</option>
            <option value="80" ${pageInfo.pageSize == 25 ? 'selected':''}>25</option>--%>
        </select> 条
    </div>
</div>

<div class="box-tools pull-right">
    <ul class="pagination" style="margin: 0px;">
        <li >
            <a href="javascript:goPage(1)" aria-label="Previous">首页</a>
        </li>
        <li><a href="javascript:goPage(${pageInfo.prePage})">上一页</a></li>
        <c:forEach begin="${pageInfo.navigateFirstPage}" end="${pageInfo.navigateLastPage}" var="i">
            <li class="paginate_button ${pageInfo.pageNum==i ? 'active':''}">
                <a href="javascript:goPage(${i})">${i}</a>
            </li>
        </c:forEach>
        <li><a href="javascript:goPage(${pageInfo.nextPage})">下一页</a></li>
        <li>
            <a href="javascript:goPage(${pageInfo.pages})" aria-label="Next">尾页</a>
        </li>
    </ul>
</div>
<form id="pageForm" action="${param.pageUrl}" method="post">
    <input type="hidden" name="pageNum" id="pageNum">
    <input type="hidden" name="pageSize" id="pageSize">
</form>
<script>
    function goPage(pageNum) {
        // document.getElementById("pageNum").value = page
        $("#pageNum").val(pageNum);

        $("#pageSize").val($("#SelectPageSize").val());

        // document.getElementById("pageForm").submit()
        $("#pageForm").submit();
    }
</script>
</body>
</html>


<%--原页面--%>
<%--<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<body>
<div class="pull-left">
    <div class="form-group form-inline">
        总共${pageInfo.pages} 页，共${pageInfo.total} 条数据。
    </div>
</div>

<div class="box-tools pull-right">
    <ul class="pagination" style="margin: 0px;">
        <li >
            <a href="javascript:goPage(1)" aria-label="Previous">首页</a>
        </li>
        <li><a href="javascript:goPage(${pageInfo.prePage})">上一页</a></li>
        <c:forEach begin="1" end="${pageInfo.pages}" var="i">
            <li class="paginate_button ${pageInfo.pageNum==i ? 'active':''}">
                <a href="javascript:goPage(${i})">${i}</a>
            </li>
        </c:forEach>
        <li><a href="javascript:goPage(${pageInfo.nextPage})">下一页</a></li>
        <li>
            <a href="javascript:goPage(${pageInfo.pages})" aria-label="Next">尾页</a>
        </li>
    </ul>
</div>
<form id="pageForm" action="${param.pageUrl}" method="post">
    <input type="hidden" name="pageNum" id="pageNum">
</form>
<script>
    function goPage(pageNum) {
        // document.getElementById("pageNum").value = page
        $("#pageNum").val(pageNum);
        // document.getElementById("pageForm").submit()
        $("#pageForm").submit();
    }
</script>
</body>
</html>--%>
